<!--退单表-->
<script setup lang="ts">
    import {AxiosPromise} from "axios";
    import lodash from 'lodash-es'

    defineOptions({
        name: "OdsOmsRetailReturnOrderMain",
        inheritAttrs: false,
    });

    import {ElLoading, UploadFile} from "element-plus";
    import {
        getOdsOmsRetailReturnOrderMainPage,
        getOdsOmsRetailReturnOrderMainForm,
        saveOdsOmsRetailReturnOrderMain,
        deleteOdsOmsRetailReturnOrderMain,
        importOdsOmsRetailReturnOrderMain,
        exportOdsOmsRetailReturnOrderMain
    } from "@/api/odsOmsRetailReturnOrderMain";

    const queryFormRef = ref(ElForm);
    const dataFormRef = ref(ElForm);

    const loading = ref(false);
    const ids = ref<number[]>([]);
    const total = ref(0);

    const queryParams = reactive<any>({
        pageNum: 1,
        pageSize: 20,
    });

    const odsOmsRetailReturnOrderMainList = ref<[]>();

    const dialog = reactive<DialogOption>({
        visible: false,
    });
    const importDialog = reactive<DialogOption>({
        title: "退单表数据导入",
        visible: false,
    });

    const excelFile = ref<File>();
    const excelFilelist = ref<File[]>([]);
    const formData = reactive<any>({});

    const rules = reactive({
        returnOrderSn: [{ required: true, message: "请输入退单编号", trigger: "blur" }],
        returnOrderStatus: [{ required: true, message: "请输入退单状态(0 未确认,1 已确认,3 作废,10 完成)", trigger: "blur" }],
        returnShippingStatus: [{ required: true, message: "请输入退单物流状态：0未收货、1已收货,未入库、2已入库、3可入库、4已退回给客户", trigger: "blur" }],
        returnPayStatus: [{ required: true, message: "请输入财务状态：0未结算、1已结算、2待结算", trigger: "blur" }],
        returnOrderType: [{ required: true, message: "请输入0无（旧系统虚拟退货），1退货，2换货，3拒收，4拒收(原路退回)，5仅退款，6拦截入库", trigger: "blur" }],
        refundDealCode: [{ required: true, message: "请输入退单交易号", trigger: "blur" }],
        lylx: [{ required: true, message: "请输入店铺来源类型", trigger: "blur" }],
        receiverName: [{ required: true, message: "请输入收货人", trigger: "blur" }],
        receiverAddr: [{ required: true, message: "请输入收货地址", trigger: "blur" }],
        receiverMobile: [{ required: true, message: "请输入退货人手机号", trigger: "blur" }],
        returnTotalAmount: [{ required: true, message: "请输入订单总金额[商品总金额goods_amount+运费shipping_fee+手续费cod_fee]", trigger: "blur" }],
        returnOrderAmount: [{ required: true, message: "请输入买家应付金额", trigger: "blur" }],
        returnPayment: [{ required: true, message: "请输入已付金额", trigger: "blur" }],
        returnOtherDiscountFee: [{ required: true, message: "请输入订单其他折让(整单折让)", trigger: "blur" }],
        posCode: [{ required: true, message: "请输入ipos终端代码", trigger: "blur" }],
        returnShippingCode: [{ required: true, message: "请输入退货快递公司代码", trigger: "blur" }],
        returnShippingName: [{ required: true, message: "请输入退货快递物流单号", trigger: "blur" }],
        returnShippingSn: [{ required: true, message: "请输入退货快递物流单号", trigger: "blur" }],
        relatingOrderSn: [{ required: true, message: "请输入退单关联订单号", trigger: "blur" }],
        isO2o: [{ required: true, message: "请输入o2o退单", trigger: "blur" }],
        o2o: [{ required: true, message: "请输入O2O交易来源", trigger: "blur" }],
        syncStatus: [{ required: true, message: "请输入0-未同步 1-已同步 2-处理中 10-已同步到erp", trigger: "blur" }],
        returnShippingTimeRk: [{ required: true, message: "请输入退单入库时间", trigger: "blur" }],
        returnOrderMsg: [{ required: true, message: "请输入", trigger: "blur" }],
        refundCode: [{ required: true, message: "请输入平台退单编号", trigger: "blur" }],
        relatingOrderId: [{ required: true, message: "请输入", trigger: "blur" }],
        isManualReturn: [{ required: true, message: "请输入", trigger: "blur" }],
        o2oGuideId: [{ required: true, message: "请输入订单导购员ID", trigger: "blur" }],
        o2oShopId: [{ required: true, message: "请输入订单导购门店ID", trigger: "blur" }],
        receiverProvinceName: [{ required: true, message: "请输入收货人省份", trigger: "blur" }],
        receiverCityName: [{ required: true, message: "请输入收货人城市", trigger: "blur" }],
        receiverDistrictName: [{ required: true, message: "请输入收货人区", trigger: "blur" }],
        sdCode: [{ required: true, message: "请输入商店代码", trigger: "blur" }],
        sdName: [{ required: true, message: "请输入", trigger: "blur" }],
        fhck: [{ required: true, message: "请输入发货仓库", trigger: "blur" }],
        qdCode: [{ required: true, message: "请输入渠道代码", trigger: "blur" }],
        qdName: [{ required: true, message: "请输入渠道名称", trigger: "blur" }],
        addTime: [{ required: true, message: "请输入退单创建时间", trigger: "blur" }],
        lastUpdate: [{ required: true, message: "请输入最后更新", trigger: "blur" }],
    });




    /**
     * 查询
     */
    function handleQuery() {
        loading.value = true;
        getOdsOmsRetailReturnOrderMainPage(queryParams)
            .then(({ data }) => {
                odsOmsRetailReturnOrderMainList.value = data.list;
                total.value = data.total;
            })
            .finally(() => {
                loading.value = false;
            });
    }

    /**
     * 重置查询
     */
    function resetQuery() {
        queryFormRef.value.resetFields();
        queryParams.pageNum = 1;
        handleQuery();
    }

    /**
     * 行checkbox change事件
     */
    function handleSelectionChange(selection: any) {
        ids.value = selection.map((item: any) => item.id);
    }

    /**
     * 打开字典类型表单弹窗
     *
     * @param dicTypeId 字典类型ID
     */
    function openDialog(id?: number) {
        dialog.visible = true;
        if (id) {
            dialog.title = "修改退单表";
            getOdsOmsRetailReturnOrderMainForm(id).then(({ data }) => {
                Object.assign(formData, data);
            });
        } else {
            dialog.title = "新增退单表";
        }
    }

    /**
     * 字典类型表单提交
     */
    function handleSubmit() {
        dataFormRef.value.validate((isValid: boolean) => {
            if (isValid) {
                loading.value = false;
                saveOdsOmsRetailReturnOrderMain(formData)
                    .then(() => {
                        ElMessage.success("保存成功");
                        closeDialog();
                        handleQuery();
                    })
                    .finally(() => (loading.value = false));
            }
        });
    }

    /**
     * 关闭弹窗
     */
    function closeDialog() {
        dialog.visible = false;
        resetForm();
    }

    /**
     * 重置表单
     */
    function resetForm() {
        dataFormRef.value.resetFields();
        dataFormRef.value.clearValidate();

        formData.id = undefined;
    }

    /**
     * 删除退单表
     */
    function handleDelete(id?: number) {
        const dictTypeIds = [id || ids.value].join(",");
        if (!dictTypeIds) {
            ElMessage.warning("请勾选删除项");
            return;
        }

        ElMessageBox.confirm("确认删除已选中的数据项?", "警告", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
        }).then(() => {
            deleteOdsOmsRetailReturnOrderMain(dictTypeIds).then(() => {
                ElMessage.success("删除成功");
                resetQuery();
            });
        });
    }

    /** 打开导入弹窗 */
    async function openImportDialog() {
        importDialog.visible = true;
    }

    /**
     * Excel文件change事件
     *
     * @param file
     */
    function handleExcelChange(file: UploadFile) {
        if (file.size !== undefined) {
            if (file.size > 20*1024*1024) {
                ElMessage.warning("上传文件大小不能超过20M");
                return false
            }
        }
        if (!/\.(xlsx|xls|XLSX|XLS)$/.test(file.name)) {
            ElMessage.warning("上传Excel只能为xlsx、xls格式");
            excelFile.value = undefined;
            excelFilelist.value = [];
            return false;
        }
        excelFile.value = file.raw;
    }

    /** 导入提交 */
    function handleImport() {
        if (!excelFile.value) {
            ElMessage.warning("上传Excel文件不能为空");
            return false;
        }
        const importLoading = ElLoading.service({
            lock: true,
            text: '导入中...',
            background: 'rgba(0, 0, 0, 0.7)',
        })
        importOdsOmsRetailReturnOrderMain(excelFile.value).then((response) => {

            closeImportDialog();
            ElMessage.success('导入成功');
            resetQuery();
        }).finally(() => importLoading.close());
    }

    /**  关闭导入弹窗 */
    function closeImportDialog() {
        importDialog.visible = false;
        excelFile.value = undefined;
        excelFilelist.value = [];
    }

    /** 导出退单表 */
    function handleExport() {
        const strIds = [ids.value].join(",");
        exportOdsOmsRetailReturnOrderMain(strIds).then((response: any) => {
            const blob = new Blob([response.data], {
                type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8",
            });
            const a = document.createElement("a");
            const href = window.URL.createObjectURL(blob); // 下载的链接
            a.href = href;
            a.download = decodeURI(
                response.headers["content-disposition"].split(";")[1].split("=")[1]
            ); // 获取后台设置的文件名称
            document.body.appendChild(a);
            a.click(); // 点击导出
            document.body.removeChild(a); // 下载完成移除元素
            window.URL.revokeObjectURL(href); // 释放掉blob对象
        });
    }

    onMounted(() => {
        handleQuery();
    });
</script>

<template>
    <div class="app-container">
        <div class="search-container">
            <el-form ref="queryFormRef" :model="queryParams" :inline="true">
                <el-form-item label="关键词" prop="keywords">
                    <el-input
                            v-model="queryParams.keywords"
                            placeholder="关键词"
                            clearable
                            @keyup.enter="handleQuery"
                    />
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="handleQuery()"
                    ><i-ep-search />搜索</el-button
                    >
                    <el-button @click="resetQuery()"><i-ep-refresh />重置</el-button>
                </el-form-item>
            </el-form>
        </div>

        <el-card shadow="never">
            <template #header>
                <div class="flex justify-between">
                    <div>
                        <el-button
                                v-hasPerm="['sys:odsOmsRetailReturnOrderMain:save']"
                                type="success"
                                @click="openDialog()"
                        ><i-ep-plus />新增</el-button
                        >
                        <el-button
                                type="danger"
                                :disabled="ids.length === 0"
                                @click="handleDelete()"
                                v-hasPerm="['sys:odsOmsRetailReturnOrderMain:delete']"
                        ><i-ep-delete />删除</el-button
                        >
                    </div>
                    <div>
                        <el-button class="ml-3" @click="openImportDialog" v-hasPerm="['sys:odsOmsRetailReturnOrderMain:import']"
                        ><template #icon><i-ep-top /></template>导入</el-button
                        >
                        <el-button class="ml-3" @click="handleExport" v-hasPerm="['sys:odsOmsRetailReturnOrderMain:export']"
                        ><template #icon><i-ep-download /></template>导出</el-button
                        >
                    </div>
                </div>
            </template>
            <el-table
                    size="small"
                    :header-row-style="{color: 'dimgray'}"
                    v-loading="loading"
                    highlight-current-row
                    :data="odsOmsRetailReturnOrderMainList"
                    border
                    @selection-change="handleSelectionChange"
                    :height="odsOmsRetailReturnOrderMainList && odsOmsRetailReturnOrderMainList.length > 0 ? 580 : 130"
            >
                <el-table-column type="selection" width="40" align="center" show-overflow-tooltip />
                <el-table-column label="退单编号" prop="returnOrderSn" width="100" show-overflow-tooltip/>
                <el-table-column label="退单状态(0 未确认,1 已确认,3 作废,10 完成)" prop="returnOrderStatus" width="100" show-overflow-tooltip/>
                <el-table-column label="退单物流状态：0未收货、1已收货,未入库、2已入库、3可入库、4已退回给客户" prop="returnShippingStatus" width="100" show-overflow-tooltip/>
                <el-table-column label="财务状态：0未结算、1已结算、2待结算" prop="returnPayStatus" width="100" show-overflow-tooltip/>
                <el-table-column label="0无（旧系统虚拟退货），1退货，2换货，3拒收，4拒收(原路退回)，5仅退款，6拦截入库" prop="returnOrderType" width="100" show-overflow-tooltip/>
                <el-table-column label="退单交易号" prop="refundDealCode" width="100" show-overflow-tooltip/>
                <el-table-column label="店铺来源类型" prop="lylx" width="100" show-overflow-tooltip/>
                <el-table-column label="收货人" prop="receiverName" width="100" show-overflow-tooltip/>
                <el-table-column label="收货地址" prop="receiverAddr" width="100" show-overflow-tooltip/>
                <el-table-column label="退货人手机号" prop="receiverMobile" width="100" show-overflow-tooltip/>
                <el-table-column label="订单总金额[商品总金额goods_amount+运费shipping_fee+手续费cod_fee]" prop="returnTotalAmount" width="100" show-overflow-tooltip/>
                <el-table-column label="买家应付金额" prop="returnOrderAmount" width="100" show-overflow-tooltip/>
                <el-table-column label="已付金额" prop="returnPayment" width="100" show-overflow-tooltip/>
                <el-table-column label="订单其他折让(整单折让)" prop="returnOtherDiscountFee" width="100" show-overflow-tooltip/>
                <el-table-column label="ipos终端代码" prop="posCode" width="100" show-overflow-tooltip/>
                <el-table-column label="退货快递公司代码" prop="returnShippingCode" width="100" show-overflow-tooltip/>
                <el-table-column label="退货快递物流单号" prop="returnShippingName" width="100" show-overflow-tooltip/>
                <el-table-column label="退货快递物流单号" prop="returnShippingSn" width="100" show-overflow-tooltip/>
                <el-table-column label="退单关联订单号" prop="relatingOrderSn" width="100" show-overflow-tooltip/>
                <el-table-column label="o2o退单" prop="isO2o" width="100" show-overflow-tooltip/>
                <el-table-column label="O2O交易来源" prop="o2o" width="100" show-overflow-tooltip/>
                <el-table-column label="0-未同步 1-已同步 2-处理中 10-已同步到erp" prop="syncStatus" width="100" show-overflow-tooltip/>
                <el-table-column label="退单入库时间" prop="returnShippingTimeRk" width="100" show-overflow-tooltip/>
                <el-table-column label="" prop="returnOrderMsg" width="100" show-overflow-tooltip/>
                <el-table-column label="平台退单编号" prop="refundCode" width="100" show-overflow-tooltip/>
                <el-table-column label="" prop="relatingOrderId" width="100" show-overflow-tooltip/>
                <el-table-column label="" prop="isManualReturn" width="100" show-overflow-tooltip/>
                <el-table-column label="订单导购员ID" prop="o2oGuideId" width="100" show-overflow-tooltip/>
                <el-table-column label="订单导购门店ID" prop="o2oShopId" width="100" show-overflow-tooltip/>
                <el-table-column label="收货人省份" prop="receiverProvinceName" width="100" show-overflow-tooltip/>
                <el-table-column label="收货人城市" prop="receiverCityName" width="100" show-overflow-tooltip/>
                <el-table-column label="收货人区" prop="receiverDistrictName" width="100" show-overflow-tooltip/>
                <el-table-column label="商店代码" prop="sdCode" width="100" show-overflow-tooltip/>
                <el-table-column label="" prop="sdName" width="100" show-overflow-tooltip/>
                <el-table-column label="发货仓库" prop="fhck" width="100" show-overflow-tooltip/>
                <el-table-column label="渠道代码" prop="qdCode" width="100" show-overflow-tooltip/>
                <el-table-column label="渠道名称" prop="qdName" width="100" show-overflow-tooltip/>
                <el-table-column label="退单创建时间" prop="addTime" width="100" show-overflow-tooltip/>
                <el-table-column label="最后更新" prop="lastUpdate" width="100" show-overflow-tooltip/>
                <el-table-column label="" show-overflow-tooltip/>
                <el-table-column fixed="right" label="操作" align="center" width="120">
                    <template #default="scope">
                        <el-button
                                v-hasPerm="['sys:odsOmsRetailReturnOrderMain:save']"
                                type="primary"
                                link
                                size="small"
                                @click.stop="openDialog(scope.row.id)"
                        ><i-ep-edit />编辑</el-button
                        >
                        <el-button
                                v-hasPerm="['sys:odsOmsRetailReturnOrderMain:delete']"
                                type="primary"
                                link
                                size="small"
                                @click.stop="handleDelete(scope.row.id)"
                        ><i-ep-delete />删除</el-button
                        >
                    </template>
                </el-table-column>
            </el-table>

            <pagination
                    v-if="total > 0"
                    v-model:total="total"
                    v-model:page="queryParams.pageNum"
                    v-model:limit="queryParams.pageSize"
                    @pagination="handleQuery"
            />
        </el-card>

        <el-dialog
                v-model="dialog.visible"
                :title="dialog.title"
                width="500px"
                :close-on-click-modal="false"
                @close="closeDialog"
        >
            <el-form
                    ref="dataFormRef"
                    :model="formData"
                    :rules="rules"
                    label-width="150px"
            >
                    <el-form-item label="退单编号" prop="returnOrderSn">
                        <el-input v-model="formData.returnOrderSn" placeholder="请输入退单编号" clearable/>
                    </el-form-item>
                    <el-form-item label="退单状态(0 未确认,1 已确认,3 作废,10 完成)" prop="returnOrderStatus">
                        <el-input v-model="formData.returnOrderStatus" placeholder="请输入退单状态(0 未确认,1 已确认,3 作废,10 完成)" clearable/>
                    </el-form-item>
                    <el-form-item label="退单物流状态：0未收货、1已收货,未入库、2已入库、3可入库、4已退回给客户" prop="returnShippingStatus">
                        <el-input v-model="formData.returnShippingStatus" placeholder="请输入退单物流状态：0未收货、1已收货,未入库、2已入库、3可入库、4已退回给客户" clearable/>
                    </el-form-item>
                    <el-form-item label="财务状态：0未结算、1已结算、2待结算" prop="returnPayStatus">
                        <el-input v-model="formData.returnPayStatus" placeholder="请输入财务状态：0未结算、1已结算、2待结算" clearable/>
                    </el-form-item>
                    <el-form-item label="0无（旧系统虚拟退货），1退货，2换货，3拒收，4拒收(原路退回)，5仅退款，6拦截入库" prop="returnOrderType">
                        <el-input v-model="formData.returnOrderType" placeholder="请输入0无（旧系统虚拟退货），1退货，2换货，3拒收，4拒收(原路退回)，5仅退款，6拦截入库" clearable/>
                    </el-form-item>
                    <el-form-item label="退单交易号" prop="refundDealCode">
                        <el-input v-model="formData.refundDealCode" placeholder="请输入退单交易号" clearable/>
                    </el-form-item>
                    <el-form-item label="店铺来源类型" prop="lylx">
                        <el-input v-model="formData.lylx" placeholder="请输入店铺来源类型" clearable/>
                    </el-form-item>
                    <el-form-item label="收货人" prop="receiverName">
                        <el-input v-model="formData.receiverName" placeholder="请输入收货人" clearable/>
                    </el-form-item>
                    <el-form-item label="收货地址" prop="receiverAddr">
                        <el-input v-model="formData.receiverAddr" placeholder="请输入收货地址" clearable/>
                    </el-form-item>
                    <el-form-item label="退货人手机号" prop="receiverMobile">
                        <el-input v-model="formData.receiverMobile" placeholder="请输入退货人手机号" clearable/>
                    </el-form-item>
                    <el-form-item label="订单总金额[商品总金额goods_amount+运费shipping_fee+手续费cod_fee]" prop="returnTotalAmount">
                        <el-input v-model="formData.returnTotalAmount" placeholder="请输入订单总金额[商品总金额goods_amount+运费shipping_fee+手续费cod_fee]" clearable/>
                    </el-form-item>
                    <el-form-item label="买家应付金额" prop="returnOrderAmount">
                        <el-input v-model="formData.returnOrderAmount" placeholder="请输入买家应付金额" clearable/>
                    </el-form-item>
                    <el-form-item label="已付金额" prop="returnPayment">
                        <el-input v-model="formData.returnPayment" placeholder="请输入已付金额" clearable/>
                    </el-form-item>
                    <el-form-item label="订单其他折让(整单折让)" prop="returnOtherDiscountFee">
                        <el-input v-model="formData.returnOtherDiscountFee" placeholder="请输入订单其他折让(整单折让)" clearable/>
                    </el-form-item>
                    <el-form-item label="ipos终端代码" prop="posCode">
                        <el-input v-model="formData.posCode" placeholder="请输入ipos终端代码" clearable/>
                    </el-form-item>
                    <el-form-item label="退货快递公司代码" prop="returnShippingCode">
                        <el-input v-model="formData.returnShippingCode" placeholder="请输入退货快递公司代码" clearable/>
                    </el-form-item>
                    <el-form-item label="退货快递物流单号" prop="returnShippingName">
                        <el-input v-model="formData.returnShippingName" placeholder="请输入退货快递物流单号" clearable/>
                    </el-form-item>
                    <el-form-item label="退货快递物流单号" prop="returnShippingSn">
                        <el-input v-model="formData.returnShippingSn" placeholder="请输入退货快递物流单号" clearable/>
                    </el-form-item>
                    <el-form-item label="退单关联订单号" prop="relatingOrderSn">
                        <el-input v-model="formData.relatingOrderSn" placeholder="请输入退单关联订单号" clearable/>
                    </el-form-item>
                    <el-form-item label="o2o退单" prop="isO2o">
                        <el-input v-model="formData.isO2o" placeholder="请输入o2o退单" clearable/>
                    </el-form-item>
                    <el-form-item label="O2O交易来源" prop="o2o">
                        <el-input v-model="formData.o2o" placeholder="请输入O2O交易来源" clearable/>
                    </el-form-item>
                    <el-form-item label="0-未同步 1-已同步 2-处理中 10-已同步到erp" prop="syncStatus">
                        <el-input v-model="formData.syncStatus" placeholder="请输入0-未同步 1-已同步 2-处理中 10-已同步到erp" clearable/>
                    </el-form-item>
                    <el-form-item label="退单入库时间" prop="returnShippingTimeRk">
                        <el-input v-model="formData.returnShippingTimeRk" placeholder="请输入退单入库时间" clearable/>
                    </el-form-item>
                    <el-form-item label="" prop="returnOrderMsg">
                        <el-input v-model="formData.returnOrderMsg" placeholder="请输入" clearable/>
                    </el-form-item>
                    <el-form-item label="平台退单编号" prop="refundCode">
                        <el-input v-model="formData.refundCode" placeholder="请输入平台退单编号" clearable/>
                    </el-form-item>
                    <el-form-item label="" prop="relatingOrderId">
                        <el-input v-model="formData.relatingOrderId" placeholder="请输入" clearable/>
                    </el-form-item>
                    <el-form-item label="" prop="isManualReturn">
                        <el-input v-model="formData.isManualReturn" placeholder="请输入" clearable/>
                    </el-form-item>
                    <el-form-item label="订单导购员ID" prop="o2oGuideId">
                        <el-input v-model="formData.o2oGuideId" placeholder="请输入订单导购员ID" clearable/>
                    </el-form-item>
                    <el-form-item label="订单导购门店ID" prop="o2oShopId">
                        <el-input v-model="formData.o2oShopId" placeholder="请输入订单导购门店ID" clearable/>
                    </el-form-item>
                    <el-form-item label="收货人省份" prop="receiverProvinceName">
                        <el-input v-model="formData.receiverProvinceName" placeholder="请输入收货人省份" clearable/>
                    </el-form-item>
                    <el-form-item label="收货人城市" prop="receiverCityName">
                        <el-input v-model="formData.receiverCityName" placeholder="请输入收货人城市" clearable/>
                    </el-form-item>
                    <el-form-item label="收货人区" prop="receiverDistrictName">
                        <el-input v-model="formData.receiverDistrictName" placeholder="请输入收货人区" clearable/>
                    </el-form-item>
                    <el-form-item label="商店代码" prop="sdCode">
                        <el-input v-model="formData.sdCode" placeholder="请输入商店代码" clearable/>
                    </el-form-item>
                    <el-form-item label="" prop="sdName">
                        <el-input v-model="formData.sdName" placeholder="请输入" clearable/>
                    </el-form-item>
                    <el-form-item label="发货仓库" prop="fhck">
                        <el-input v-model="formData.fhck" placeholder="请输入发货仓库" clearable/>
                    </el-form-item>
                    <el-form-item label="渠道代码" prop="qdCode">
                        <el-input v-model="formData.qdCode" placeholder="请输入渠道代码" clearable/>
                    </el-form-item>
                    <el-form-item label="渠道名称" prop="qdName">
                        <el-input v-model="formData.qdName" placeholder="请输入渠道名称" clearable/>
                    </el-form-item>
                    <el-form-item label="退单创建时间" prop="addTime">
                        <el-input v-model="formData.addTime" placeholder="请输入退单创建时间" clearable/>
                    </el-form-item>
                    <el-form-item label="最后更新" prop="lastUpdate">
                        <el-input v-model="formData.lastUpdate" placeholder="请输入最后更新" clearable/>
                    </el-form-item>
            </el-form>
            <template #footer>
                <div class="dialog-footer">
                    <el-button type="primary" @click="handleSubmit">确 定</el-button>
                    <el-button @click="closeDialog">取 消</el-button>
                </div>
            </template>
        </el-dialog>

        <!-- 导入弹窗 -->
        <el-dialog
                v-model="importDialog.visible"
                :title="importDialog.title"
                width="600px"
                append-to-body
                @close="closeImportDialog"
        >
            <el-form label-width="80px">
                <el-form-item label="Excel">
                    <el-upload
                            class="upload-demo"
                            action=""
                            drag
                            :auto-upload="false"
                            accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
                            :file-list="excelFilelist"
                            :on-change="handleExcelChange"
                            :limit="1"
                    >
                        <el-icon class="el-icon--upload">
                            <i-ep-upload-filled/>
                        </el-icon>
                        <div class="el-upload__text">
                            将文件拖到此处，或
                            <em>点击上传</em>
                        </div>
                        <template #tip>
                            <div class="el-upload__tip">xls/xlsx files</div>
                        </template>
                    </el-upload>
                </el-form-item>
            </el-form>
            <template #footer>
                <div class="dialog-footer">
                    <el-button type="primary" @click="handleImport">确 定</el-button>
                    <el-button @click="closeImportDialog">取 消</el-button>
                </div>
            </template>
        </el-dialog>
    </div>
</template>
